package cn.exrick.xboot.modules.activiti.entity.business;

import cn.exrick.xboot.base.XbootBaseEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.springframework.data.annotation.Transient;
import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author lihuan
 */
@Data
@Entity
@Table(name = "t_workorder")
@TableName("t_workorder")
@ApiModel(value = "工单流转")
public class Workorder extends XbootBaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "关联流程申请表id")
    private String actBusinessId;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "申请用户")
    private String applyUser;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "表单路由名")
    private String routeName;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "流程实例id")
    private String procInstId;

    @Transient
    @TableField(exist=false)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "提交申请时间")
    private Date applyTime;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "状态 0草稿默认 1处理中 2结束")
    private Integer status;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "结果状态 0未提交默认 1处理中 2通过 3驳回")
    private Integer result;

    @ApiModelProperty(value = "导入工单编号")
    @Column(length = 18)
    private String importId;
    
    @ApiModelProperty(value = "热线号码")
    @Column(length = 20)
    private String hotlineNumber;
    
    @ApiModelProperty(value = "受理单位")
    @Column(length = 255)
    private String acceptUnit;
    
    @ApiModelProperty(value = "来电人，拨入的用户姓名")
    @Column(length = 50)
    private String callerName;
    
    @ApiModelProperty(value = "来电号码")
    @Column(length = 18)
    private String callerNumber;
    
    @ApiModelProperty(value = "联系方式")
    @Column(length = 255)
    private String callerContact;
    
    @ApiModelProperty(value = "来电人地址")
    @Column(length = 255)
    private String callerAddress;
    
    @ApiModelProperty(value = "问题分类")
    @Column(length = 32)
    private String problemType;
    
    @ApiModelProperty(value = "工单分类")
    @Column(length = 32)
    private String orderType;
    
    @ApiModelProperty(value = "发生地址")
    @Column(length = 255)
    private String eventAddress;
    
    @ApiModelProperty(value = "来电时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date callinTime;
    
    @ApiModelProperty(value = "被反映单位")
    @Column(length = 255)
    private String reflectedUnit;
    
    @ApiModelProperty(value = "工单标题")
    @Column(length = 255)
    private String orderTitle;
    
    @ApiModelProperty(value = "主要内容")
    @Column(length = 2000)
    private String orderContent;
    
    @ApiModelProperty(value = "处理意见")
    @Column(length = 2000)
    private String handleOpinion;
    
    @ApiModelProperty(value = "派单人员")
    @Column(length = 255)
    private String assignUid;
    
    @ApiModelProperty(value = "派单时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date assignTime;
    
    @ApiModelProperty(value = "截止时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date endTime;
    
    @ApiModelProperty(value = "处理时限")
    private Integer processDeadline;
    
    @ApiModelProperty(value = "承办单位")
    @Column(length = 255)
    private String contractor;
    
    @ApiModelProperty(value = "处理情况")
    @Column(length = 2000)
    private String processDetail;
    
    @ApiModelProperty(value = "工单办结时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date orderFinishTime;
    
    @ApiModelProperty(value = "主办人系统id,主办人唯一")
    @Column(length = 255)
    private String sponsorUid;
    
    @ApiModelProperty(value = "协办人系统id,协办人可以多个，逗号分隔")
    @Column(length = 255)
    private String coSponsorUid;
}